package com.pachong.android.baseuicomponent.fragment;

import android.view.LayoutInflater;

import com.pachong.android.baseuicomponent.CompState;
import com.pachong.android.baseuicomponent.ILoadable;
import com.pachong.android.baseuicomponent.LoadState;
import com.pachong.android.baseuicomponent.NetUtils;
import com.pachong.android.baseuicomponent.view.BottomLoadStateView;


/**
 * 带RecyclerView的Fragment.
 *
 * 对RecyclerView做了基本的设置,可以满足平时正常的需求,同时对外提供扩展,用户可以调用API修改设置和扩展功能
 *
 * @author Vivi Peng
 * @version 1.0.0
 * @e-mail pengveivei@sina.cn
 * @QQ 897058316
 * @since 1979-01-01
 */
public abstract class LoadableFragment extends BaseFragment implements ILoadable {

	@Override
	public void startLoading() {
		if (NetUtils.getNetworkStatus(getActivity()) == NetUtils.NETWORK_STATE_IDLE) {
			setState(CompState.EMPTY_INVALID_NEWWORK);
			return;
		}

		setState(CompState.EMPTY_REFRESHING);
		onStartLoading();

	}


	@Override
	public void setAutoLoading(boolean auto) {

	}

	@Override
	public void setTriggerLoadItemCount(int itemCount) {

	}

	@Override
	public BottomLoadStateView createBottomLoadStateView(LayoutInflater inflater) {
		return null;
	}


	@Override
	public void changeLoadState(LoadState loadState) {

	}



}
